#include "basic.h"
#define ElemType BiTNode*

void init(LinkQueue &Q);
void destory(LinkQueue &Q);

void enQueue(LinkQueue &Q,ElemType e);
void deQueue(LinkQueue &Q,ElemType &e);

void getHead(LinkQueue &Q,ElemType &e);
bool isEmpty(LinkQueue Q);
bool isFul(LinkQueue S);

void init(LinkQueue &Q){
	Q.front=(LNode*)malloc(sizeof(LNode));
	Q.rear=Q.front;
	Q.front->next=NULL;
}
void destory(LinkQueue &Q){
	ElemType e;
	while(!isEmpty(Q))
		deQueue(Q,e);
	free(Q.front);
}
bool isEmpty(LinkQueue Q){
	if(Q.rear==Q.rear)
		return true;
	return false;
}
void enQueue(LinkQueue &Q,ElemType e){
	LNode* p = (LNode*)malloc(sizeof(LNode));
	p->next=NULL;
	p->data=e;
	Q.rear->next=p;
	Q.rear=p;
}
void deQueue(LinkQueue &Q,ElemType &e){
	if(isEmpty(Q))
		return;
	LNode* p = Q.front->next;
	e = p->data;
	Q.front->next = p->next;
	if(Q.rear==p)
		Q.rear=Q.front;
	free(p);
}
void getHead(LinkQueue &Q,ElemType &e){
	e = Q.rear->data;
}
bool isFull(LinkQueue S){
	return false;
}













